Brain Tumor Detection Using Image Processing Techniques

129

be defined as a vector as in Equation 4.17 [44]:

f =



Gx

Gy



=

∂f

∂x

∂f

∂y

(4.17)

Mathematically, the gradient magnitude is calculated as follows [44]:

G |f(x, y)| =



G2x + G2y

(4.18)

The approximate magnitude is calculated using the Equation 4.19 [44]:

G |f(x, y)| = |Gx| + |Gy|

(4.19)

The gradient direction θ(x, y) is calculated using the Equation 4.20 [44]:

θ(x, y) = arctan

Gy

Gx



(4.20)

The partial derivatives ∂f/∂x and ∂f/∂y must be calculated at each pixel

in the image in order to determine the gradient. Numerical approximations

of these derivatives are calculated in the neighborhood of each point while

working with digital images [45]. The following paragraphs provide general

information about the most commonly used gradient-based edge detectors,

Roberts operator, Sobel operator and Prewitt operator; their primary distinc-

tion is in the way they carry out this computation.

Roberts Edge Detection

Roberts edge detector, introduced by Roberts [46], is one of the earliest

edge detectors, and is also referred to as the cross gradient operator. It is

based on the idea of cross diagonal differences, and is limited to the diagonal

elements. It does not take into account horizontal or vertical neighbors. The

mask pair for the Roberts edge detector can be found in Equation 4.21:

Gx =



1

0

0

1



Gy =



0

1

1

0



(4.21)

The computation of the gradient value pair for the I(x, y) pixel on an I

image using the Roberts method is as follows [47]:

Gx = I(x, y)I(x + 1, y + 1)

(4.22)

Gy = I(x + 1, y)I(x, y + 1)

(4.23)